import java.util.Scanner;

public class Brave {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int[]f=new int[n];
        int max=1;
        for (int i=0;i<n;i++){
            f[i]=scan.nextInt();
        }
        
        int[]dp=new int[n];
        dp[0]=1;
        
        for(int i=1;i<n;i++) {
            for (int j = 0; j < i; j++) {
                if (f[i] > f[j]) {
                    dp[i] = Math.max(dp[j] + 1, dp[1]);
                } else {
                    dp[i] = Math.max(1, dp[i]);
                }


            }
            max = Math.max(max, dp[i]);
        }
        System.out.println(max);
    }
}
